<script type="text/javascript">
function verify()
{
		 if(document.frm.detail.value == "")
		{
				alert("请输入客户详细信息！");
				document.frm.detail.focus();
				return false;
		}
		return true;
}

</script>
<h3>&nbsp; <img alt="icos.jpg" src="/sites/default/files/styles/medium/public/icos.jpg">&nbsp; <span>用户服务状态管理</span></h3>
<div class="account-item">
	<form  name="frm" action="" method="post">
					<table border="0" align="center" width="930px" cellpadding="0" cellspacing="0" class="order">
						<tr>
							<td class="stamp_td"><span>服务名：</span></td>
							<td class="stamp_td"><span>用户名：</span></td>
							<td class="stamp_td"><span>状态：</span></td>
							<td class="stamp_td"><span>详细信息：</span></td>
						</tr>
				<?php foreach ($status as $key => $v)
						{
								$sta [$v ->service_nid] = $v;
						}
				?>
                 <?php foreach ($myaccount as $key => $v)
						{
								$mya [$v ->revision_id] = $v;
						}
				?>
				<?php foreach ($mya as $key =>$account):?>
						<tr>

							<td class="stamp_td"><INPUT type="text"  name="service_name[]"  value="<?php echo $account->field_title_value?>" readonly="readonly">
							<input type="hidden" name="service_id[]" value='<?php echo $account->revision_id?>'>
							</td>
			

							
				
                   <?php    if(empty($status))//无数据时
                        {
                        ?>
                        <td class="stamp_td"><INPUT type="text"  name="user_name[]" value="<?php echo $user_data->name;?>">
                        <input type="hidden" name="user_uid" value='<?php echo $user_data->uid;?>'>
                        </td>
                      <td class="stamp_td">
								<label style="float:left;width:80px;"><input type="radio" name="status<?php echo $key?>" value="1" style="width:15px;height:15px;">开启</label>
								<label style="float:left;width:80px;"><input type="radio" name="status<?php echo $key?>" value="0"  checked style="width:15px;height:15px;margin-left:25px;">关闭</label>
							</td>  
                        <td class="stamp_td"><textarea name="detail[]" class="protext" cols="30" rows="2"></textarea></td>
                     <?php   
						 } else {//存在数据
                     ?>   
                     <td class="stamp_td"><INPUT type="text"  name="user_name[]" value="<?php echo $sta[$account->revision_id]->name?>">
                     <input type="hidden" name="user_uid" value='<?php echo $sta[$account->revision_id]->uid;?>'>
                     </td>
					<td class="stamp_td">
						<label style="float:left;width:80px;"><input type="radio" name="status<?php echo $key?>" value="1" <?php if(@$sta[$key]-> status == "1" ) echo " checked=\"checked\""; ?>style="width:15px;height:15px;">开启</label>
						<label style="float:left;width:80px;"><input type="radio" name="status<?php echo $key?>" value="0" <?php if(@$sta[$key]-> status == "0" ) echo " checked=\"checked\""; ?>style="width:15px;height:15px;margin-left:25px;">关闭</label>
					</td>
					<td class="stamp_td"><textarea name="detail[]" class="protext" cols="30" rows="2"><?php echo $sta[$account->revision_id]->detail ?></textarea></td>
                              <?php }?>
							
					   </tr>
			<?php endforeach;?>
					</table>

			<div class="bottom">
				<input type="submit" value="提交" class="sub" name="present"    onclick="return verify()">
				<?php if(empty($status))
				{?>
				<input type="hidden"  value='insert' name='redact'  value='submit'>
				<?php }else{?>
				<input type="hidden" value='update' name='redact'  value='submit'>
				<?php }?>
			</div>
	</Form>	
</div>
<!-- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -->







<!-- update -->
<script type="text/javascript">
// $(document).ready(function()
// 		{
// 			$('#edit-field-a').change(function()
// 					{
// 						var str=$(this).children('option:selected').val();//这是selected的值
// 						alert(str);
// 					}
// 			)
// 		}) 
</script>











